﻿@model WalkingTec.Mvvm.Core.BaseVM
@using System.Text.Json

<div class="layui-row layui-col-space15" id="frontpage">
  <div class="layui-col-md12">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">快捷方式</div>
          <div class="layui-card-body">
            <div class="layadmin-carousel layadmin-shortcut">
              <div carousel-item>
                <ul class="layui-row layui-col-space10">
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetInfo/Index">
                      <i class="layui-icon layui-icon-form"></i>
                      <cite>资产登记</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetAllocation/Index">
                      <i class="layui-icon layui-icon-templeate-1"></i>
                      <cite>资产调拨</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetRepair/Index">
                      <i class="layui-icon layui-icon-util"></i>
                      <cite>资产维修</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetScrap/Index">
                      <i class="layui-icon layui-icon-template"></i>
                      <cite>资产报废</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetConsuming/Index">
                      <i class="layui-icon layui-icon-auz"></i>
                      <cite>资产领用</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetDonation/Index">
                      <i class="layui-icon layui-icon-console"></i>
                      <cite>资产捐赠</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetBorrow/index" target="_blank">
                      <i class="layui-icon layui-icon-template-1"></i>
                      <cite>资产借出</cite>
                    </a>
                  </li>
                  <li class="layui-col-xs3">
                    <a lay-href="AssetManage/AssetUype/index" target="_blank">
                      <i class="layui-icon layui-icon-read"></i>
                      <cite>资产类型</cite>
                    </a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">资产状态统计</div>
          <div class="layui-card-body">
            <div class="layadmin-carousel layadmin-backlog">
              <div carousel-item>
                <ul class="layui-row layui-col-space10">
                  <li class="layui-col-xs4">
                    <a lay-href="" class="layadmin-backlog-body">
                      <h3>在用</h3>
                      <p><cite id="OnUse">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs4">
                    <a lay-href="" class="layadmin-backlog-body">
                      <h3>维修</h3>
                      <p><cite id="Repair">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs4">
                    <a lay-href="" class="layadmin-backlog-body">
                      <h3>闲置</h3>
                      <p><cite id="NoUse">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs4">
                    <a lay-href="" class="layadmin-backlog-body">
                      <h3>报废</h3>
                      <p><cite id="Scrap">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs4">
                    <a lay-href="" class="layadmin-backlog-body">
                      <h3>捐赠</h3>
                      <p><cite id="Donation">0</cite></p>
                    </a>
                  </li>
                  <li class="layui-col-xs4">
                    <a lay-href="" class="layadmin-backlog-body">
                      <h3>借用</h3>
                      <p><cite id="Borrow">0</cite></p>
                    </a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>

      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">资产数量统计</div>
          <div class="layui-card-body">
             <wt:chart show-legend="false" show-tooltip="true" type="Pie" height="360"
              trigger-url="/Home/GetAssetTypeCount" />
          </div>
        </div>
      </div>
      <div class="layui-col-md6">
        <div class="layui-card">
          <div class="layui-card-header">资产（使用中）</div>
          <div class="layui-card-body">
            <wt:chart show-legend="false" show-tooltip="true" type="Pie" height="360"
              trigger-url="/Home/GetAssetCountChart" />
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script>
  $("#frontpage").parents(".layui-card").css("background-color", "#eee").css("height", "unset");
  $.get("/Home/GetAssetCount", function (r) {
    if (r === undefined || r === null) {
      return;
    }
    $("#OnUse").html(r.OnUse);
    $("#Repair").html(r.Repair);
    $("#NoUse").html(r.NoUse);
    $("#Scrap").html(r.Scrap);
    $("#Donation").html(r.Donation);
    $("#Borrow").html(r.Borrow);
  });
  

</script>
